return {
    'rcarriga/nvim-dap-ui',
    dependencies = {
        'mfussenegger/nvim-dap',
        'nvim-neotest/nvim-nio',
        'nvim-telescope/telescope-dap.nvim',
    },
    ft = {'c', 'cpp', 'cmake', 'rust', 'zig', 'python', 'lua'},
    opts = {
        layouts = {
            {
                elements = {
                    { id = "breakpoints", size = 0.15 },
                    { id = "stacks",      size = 0.25 },
                    { id = "scopes",      size = 0.45, },
                    { id = "watches",     size = 0.15 },
                },
                size = 50,
                position = "left", -- Can be "left" or "right"
            },
            {
                elements = {
                    { id = "console", size = 0.65 },
                    { id = "repl",    size = 0.35 },
                },
                size = 15,
                position = "bottom", -- Can be "bottom" or "top"
            },
        }
    },
    config = function(_, opts)
        -- 同步 nvim-dap 事件jjj
        local dap, dapui = require('dap'), require('dapui')
        dapui.setup(opts)
        dap.listeners.before.attach.dapui_config = dapui.open
        dap.listeners.before.launch.dapui_config = dapui.open
        dap.listeners.before.event_terminated.dapui_config = dapui.close
        dap.listeners.before.event_exited.dapui_config = dapui.close

        -- telescope 配置
        require('telescope').load_extension('dap')

        -- codelldb 配置
        dap.adapters.codelldb = {
            type = 'server',
            port = '${port}',
            executable = {
                command = 'codelldb',
                args = { '--port', '${port}' },
                -- On windows you may have to uncomment this:
                -- detached = false,
            }
        }

        -- cpp/c 配置
        local lldb_launch = {
            name = 'lldb launch',
            type = 'codelldb',
            request = 'launch',
            program = function()
                return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
            end,
            cwd = '${workspaceFolder}',
            stopOnEntry = false,
        }

        dap.configurations.c = { vim.tbl_extend('force', lldb_launch, { name = 'c launch' }), }
        dap.configurations.cpp = { vim.tbl_extend('force', lldb_launch, { name = 'cpp launch' }), }

        -- 快捷键配置
        local km = vim.keymap
        local widgets = require('dap.ui.widgets')
        km.set('n', '<F5>', dap.continue, {desc = 'dap 继续'})
        km.set('n', '<F9>', dap.toggle_breakpoint, {desc = 'dap toggle 断点'})
        km.set('n', '<F10>', dap.step_over, {desc = 'dap 下一步'})
        km.set('n', '<F11>', dap.step_into, {desc = 'dap 进入'})
        km.set('n', '<F12>', dap.step_out, {desc = 'dap 跳出'})
        km.set({ 'n', 'v' }, '<Leader>dh', widgets.hover, {desc = 'dap 悬停查看'})
        km.set({ 'n', 'v' }, '<Leader>dp', widgets.preview, {desc = 'dap 预览'})
        km.set('n', '<Leader>df', function() widgets.centered_float(widgets.frames) end, {desc = 'dap 查看栈帧'})
        km.set('n', '<Leader>ds', function() widgets.centered_float(widgets.scopes) end, {desc = 'dap 查看局部变量'})

        -- 配置断点样式
        local sign_define = vim.fn.sign_define
        local signs = {
            DapBreakpoint = { text = '', texthl = 'DapUIStop', linehl = '', numhl = '' },
            DapBreakpointCondition = { text = '', texthl = 'DaqUISouce', linehl = '', numhl = '' },
            DapBreakpointRejected = { text = '', texthl = 'DapUINormal', linehl = '', numhl = '' },
            DapLogPoint = { text = '', texthl = 'DapUIScope', linehl = '', numhl = '' },
            DapStopped = { text = '', texthl = 'DapUIRestart', linehl = 'debugPC', numhl = 'DapUIBreakPointsCurrentLine' },
        }
        for name, opt in pairs(signs) do
            sign_define(name, opt)
        end
    end
}
